if __name__ == '__main__':
    dict_ticket={'G1569':['北京南-天津南','18:05','18:39','00:34'],
                 'G1567':['北京南-天津南','18:15','18:49','00:34'],
                 'G8917':['北京南-天津西','18:20','19:19','00:59'],
                 'G203':['北京南-天津南','18:15','18:49','00:34'],
                }
    print('车次\t\t出发站-到达站\t\t出发时间\t\t\t到达时间\t\t\t历时时长')
    for item in dict_ticket:
        print(item,end='  ')
        for i in dict_ticket.get(item):
            print(i,end='\t\t\t')
        print()#默认换行
    a=input('请输入要购买的车次')
    flag=False
    for item in dict_ticket:
        if item==a:
            flag=True
            break
    if flag==False:
        return #return只能写在def函数里面 所以会报错
    b=input('请输入乘车人')
    print(f'{(dict_ticket[a])[0]}{a}车次已经购买')
    print(f'发车时间为{(dict_ticket[a])[1]}')
    print(f'请{b}做好乘车准备')


